package com.weavernorth.humanresource.util;

import weaver.conn.RecordSet;
import weaver.general.Util;

/**
 * @Author: BruseeWang
 * @Date: 2021/3/26 16:55
 * @Description:
 */
public class commonUtil {

    /***
     * 根据工作地区ID获取工作地区编码
     * @param gzdq
     * @return
     */
    public static String getGzdqCode(String gzdq){
        String strResult="";
        RecordSet rs=new RecordSet();
        if(!gzdq.equals("")) {
            try {
                String strQeury = "select id,gzdq,dqbm from uf_GZDQ where id='" + gzdq + "'";
                rs.execute(strQeury);
                while (rs.next()) {
                    strResult = Util.null2String(rs.getString("dqbm"));
                }
            }catch (Exception ex){
                strResult="";
            }
        }
        return strResult;
    }
    /***
     * 根据离职原因说明ID获取离职原因编码
     * @param lzyysm
     * @return
     */
    public static String getLzyysmCode(String lzyysm){
        String strResult="";
        RecordSet rs=new RecordSet();
        if(!lzyysm.equals("")) {
            try {
                String strQeury = "select id,code from uf_lzyysm where id='" + lzyysm + "'";
                rs.execute(strQeury);
                while (rs.next()) {
                    strResult = Util.null2String(rs.getString("code"));
                }
            }catch (Exception ex){
                strResult="";
            }
        }
        return strResult;
    }
}
